<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    {include file="common/cssInfo" /}

    <title>列表页</title>

</head>

<body>
    <header>
        {include file="common/nav" /}
    </header>
    <div class="main-container container-fluid">
        <div class="page-container">
            <!-- 侧边栏 -->
            {include file="common/sidebar" /}
            <!-- Page Content -->
            <div class="page-content">
                <!-- Page Breadcrumb -->
                <div class="page-breadcrumbs">
                    <ul class="breadcrumb">
                        <li>
                            <a href="#">系统</a>
                        </li>
                        <li class="active">配置项</li>
                    </ul>
                </div>
                <!-- /Page Breadcrumb -->

                <!-- Page Body -->
                <div class="page-body">
                    <button type="button" tooltip="添加配置" class="btn btn-sm btn-azure btn-addon">
                        网站配置
                    </button>

                    <div class="row">
                        <div class="col-lg-12 col-sm-12 col-xs-12">
                            <div class="widget">
                                <div class="widget-body">
                                    <div class="flip-scroll">
                                        <form action="" method="post">
                                            <table class="table table-bordered table-hover">
                                                <thead class="">
                                                    <tr>
                                                        <th class="text-center" width="20%">中文名称</th>
                                                        <th style="padding-left:26.2%;">配置值</th>
                                                    </tr>
                                                </thead>
                                                <tbody>
                                                    {volist name="confres" id="conf"}
                                                    <tr>
                                                        <td align="center">{$conf.cnname}</td>
                                                        <td>
                                                            {switch $conf.type}
                                                            {case 1}
                                                                <!-- 文本框 -->
                                                                <input type="text" class="form-control" name="{$conf.enname}"
                                                                placeholder="" value="{$conf.value}" style="width:60%;" />
                                                            {/case}
                                                            <!-- 文本域 -->
                                                            {case 2}
                                                                <textarea name="{$conf.enname}" class="form-control" style="width:60%;" >{$conf.value}</textarea>
                                                            {/case}
                                                            <!-- 单选按钮 -->
                                                            {case 3}
                                                                {if condition="$conf['values']"}
                                                                    <?php 
                                                                        $arr =explode(',',$conf['values']);
                                                                    ?>
                                                                {/if}
                                                                <?php
                                                                    foreach($arr as $k => $v){
                                                                ?>
                                                                    <div class="radio">
                                                                        <label style="float:left; margin-right: 20px;">
                                                                            <input type="radio" {if condition="$v == $conf['value']"}checked="checked"{/if} name="{$conf.enname}" value="<?php echo $v ?>" />
                                                                            <span class="text"><?php echo $v ?></span>
                                                                        </label>
                                                                    </div>
                                                                <?php } ?>    
                                                            {/case}
                                                            <!-- 复选框 -->
                                                            {case 4}
                                                                <label>
                                                                    <input type="checkbox" {if condition="$conf['value'] == $conf['values']"}checked="checked"{/if} 
                                                                        name="{$conf.enname}" class="colored-success" value="{$conf.values}" />
                                                                    <span class="text">{$conf.values}</span>
                                                                </label>
                                                            {/case}
                                                            <!-- 下拉菜单 -->
                                                            {case 5}
                                                                {if condition="$conf['values']"}
                                                                    <?php 
                                                                        $arrselect =explode(',',$conf['values']);
                                                                    ?>
                                                                {/if}
                                                                <select name="{$conf.enname}">
                                                                <?php
                                                                    foreach($arrselect as $k => $v2){
                                                                        echo $v2;
                                                                ?>
                                                                    <option {if condition="$v2 == $conf['value'] "}selected="selected"{/if} value="<?php echo $v2 ?>"><?php echo $v2 ?></option>
                                                                <?php } ?>
                                                                </select>
                                                            {/case}
                                                            {default /}未知配置
                                                            {/switch}
                                                        </td>
                                                    </tr>
                                                    {/volist}
                                                </tbody>
                                            </table>
                                            <div class="form-group" style="padding-top:20px; padding-bottom:20px;">
                                                <div class="col-sm-offset-5 col-sm-7">
                                                    <button type="submit" class="btn btn-primary" >提交修改</button>
                                                </div>
                                            </div>
                                        </form>
                                    </div>
                                    <div style="margin-top:20px;">

                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                </div>
                <!-- /Page Body -->
            </div>
            <!-- /Page Content -->
        </div>
    </div>

    <!-- 引入js -->
    {include file="common/jsInfo" /}
</body>

</html>